<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%>


<div class="maindivForm">

	<sf:form modelAttribute="registerObj">
		<h3>Mode of Payment</h3>
		<table width="60%">
			<tr>
				<td width="50%"><input type="radio" onclick="javascript:clicksubmit('_eventId_paypal');"/> Paypal</td>
				<td><input type="radio" onclick="javascript:clicksubmit('_eventId_cheque');"/> Cheque</td>
			</tr>
		</table>
		<div style="display:none;"> 
		<input type="submit" name="_eventId_paypal" value="Pay by Credit Card">
		<input type="submit" name="_eventId_cheque" value="Pay by Cheque">
		</div>
		<input type="hidden" name="_flowExecutionKey" value="${flowExecutionKey}" />
	<br/><br/>
		<table border="1" width="90%" class="paymentsummarytbl">
			<tr>
				<th width="5%">No</th>
				<th width="40%">Name</th>
				<th width="45%">Conference Package</th>
				<th>Price</th>
			</tr>
			
			<c:forEach items="${registerObj.participantList}" var="p" varStatus="pStatus">
			<tr>
				<td>${pStatus.index+1}</td>
				<td><c:out value="${p.firstName} ${p.lastName}"/></td>
				<td>
					<ul>
						<c:choose>
						<c:when test="${p.packageId eq 1}"><li>Full Conference - 
							<c:choose>
								<c:when test="${p.subamount[0] le 0}">Free</c:when>
								<c:otherwise><fmt:formatNumber value="${p.subamount[0]}" currencySymbol="S$" type="currency"/></c:otherwise>
							</c:choose>
						</li></c:when>
						<c:when test="${p.packageId eq 2}"><li>Plenary Session Only -
							<c:choose>
								<c:when test="${p.subamount[1] le 0}">Free</c:when>
								<c:otherwise><fmt:formatNumber value="${p.subamount[1]}" currencySymbol="S$" type="currency"/></c:otherwise>
							</c:choose>
						</li></c:when>
						<c:when test="${p.packageId eq 3}"><li>Breakout Sessions Only - 
							<c:choose>
								<c:when test="${p.subamount[2] le 0}">Free</c:when>
								<c:otherwise><fmt:formatNumber value="${p.subamount[2]}" currencySymbol="S$" type="currency"/></c:otherwise>
							</c:choose>
						</li></c:when>
						</c:choose>
						<c:if test="${p.post1}"><li>Post-Conference Workshop 1 - 
							<c:choose>
								<c:when test="${p.subamount[3] le 0}">Free</c:when>
								<c:otherwise><fmt:formatNumber value="${p.subamount[3]}" currencySymbol="S$" type="currency"/></c:otherwise>
							</c:choose>
						</li></c:if>
						<c:if test="${p.post2}"><li>Post-Conference Workshop 2 -
							<c:choose>
								<c:when test="${p.subamount[4] le 0}">Free</c:when>
								<c:otherwise><fmt:formatNumber value="${p.subamount[4]}" currencySymbol="S$" type="currency"/></c:otherwise>
							</c:choose> 
						</li></c:if>
					</ul>
				</td>
				<td><fmt:formatNumber value="${p.amount}" currencySymbol="S$" type="currency"/></td>
			</tr>
			</c:forEach>
			<tr>
				<td></td>
				<td colspan="2" style="text-align: right;"><b>Total</b></td>
				<td><fmt:formatNumber value="${registerObj.amount}" currencySymbol="S$" type="currency"/></td>
			</tr>
		</table>
	</sf:form>
	<br/><br/>
</div>

